package com.mojo.jedis.config;

import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

import javax.annotation.Resource;

/**
 * @author <a href="mailto:mojo_jj@163.com">Mojo</a>
 */
@Configuration
public class WebMvcConfig implements WebMvcConfigurer {
    @Resource
    private RateLimiterInterceptor rateLimiterInterceptor;
    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(rateLimiterInterceptor).addPathPatterns("/**");
    }
}
